Class BatchProcessor<T,​S>

  • Type Parameters:
    T - the object Type to be processed.
    S - the expected output Type of the processing.

    public final class BatchProcessor<T,​S>
    extends java.lang.Object
    Used to process one or multiple objects. Processing is accomplished via a level of abstraction. This is the primary control structure of the SNBA code base.
    Version:
    3.1 May 28, 2015
    Author:
    Charles Allen Schultz II
    • Constructor Summary

      Constructors 
      Constructor Description
      BatchProcessor()
      Constructs a BatchProcessor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.ArrayList<java.util.ArrayList<S>> processMultiple​(T[] toProcess, Processable<T,​S> processor)
      Processes multiple files.
      java.util.ArrayList<S> processSingular​(T toProcess, Processable<T,​S> processor)
      Processes a singular object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BatchProcessor

        public BatchProcessor()
        Constructs a BatchProcessor. Since a BatchProcessor object only relies on restrictions set using angle bracket operators, no other information is needed for proper instantiation.
    • Method Detail

      • processSingular

        public java.util.ArrayList<S> processSingular​(T toProcess,
                                                      Processable<T,​S> processor)
        Processes a singular object. Utilizes a system of abstraction to allow multiple parts of the program to rely on the same infrastructure for performing mass-processing.
        Parameters:
        toProcess - the T object to process.
        processor - the Processable object to process with.
        Returns:
        the S object array containing the results of the processing.
      • processMultiple

        public java.util.ArrayList<java.util.ArrayList<S>> processMultiple​(T[] toProcess,
                                                                           Processable<T,​S> processor)
        Processes multiple files. This method does so by calling the processSingular(T, Processable) method.
        Parameters:
        toProcess - the T object array containing the objects to be processed.
        processor - the Processable object to process the objects with.
        Returns:
        the S object two dimensional array containing the collective results of the processing.